<%DIRECTIVE DYNAMIC;%>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
	<h5 class="modal-title" >修改</h5>
</div>
<form id="eidtForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/project/editDo" method="post">
	<div class="modal-body ">
    	<input type="hidden" name="id" value="${obj.project.id!}">
      	<input type="hidden" name="createAt" value="${obj.project.createAt!}">
      	<input type="hidden" name="createBy" value="${obj.project.createBy!}">
   		<div class="row mb10">
       		<div class="col-lg-12">
           		<div class="form-group">
               		<label for="name" class="col-sm-2 control-label">名称</label>

                   	<div class="col-sm-8">
                    	<input type="text" id="name" class="form-control" name="name" value="${obj.project.name!}" required="required" placeholder="名称">
                   	</div>
            	</div>
          		<div class="form-group">
                	<label for="code" class="col-sm-2 control-label">编码</label>

                 	<div class="col-sm-8">
                    	<input type="text" id="code" class="form-control" name="code" value="${obj.project.code!}"  placeholder="编码">
                   	</div>
               	</div>
              	<div class="form-group">
                	<label for="driving_type" class="col-sm-2 control-label">准驾车型</label>
							
                 	<div class="col-sm-8">
                   		<select id="driving_type" name="driving_type" class="form-control" required="required">
                         	<%for(driving in obj.drivings){%>
                             	<option value="${driving.id}" <% if(obj.project.driving_type==driving.id){ %> selected="selected" <% } %>>${driving.name}</option>
                          	<%}%>
                        </select>
                  	</div>
              	</div>
            	<div class="form-group">
             		<label for="subject" class="col-sm-2 control-label">项目</label>
							
                   	<div class="col-sm-8">
                  		<select id="subject" name="subject" class="form-control" required="required">
                        	<%for(subject in obj.subjects){%>
                            	<option value="${subject.id}" <% if(obj.project.subject==subject.id){ %> selected="selected" <% } %>>${subject.name}</option>
                          	<%}%>
                       	</select>
                   	</div>
              	</div>
             	<div class="form-group">
               		<label for="state" class="col-sm-2 control-label">状态</label>

                  	<div class="col-sm-8">
                   		<input type="radio" name="state" required="required" value="0"  <% if(obj.project.state==0){ %> checked="checked" <% } %>/>正常
                      	<input type="radio" name="state" required="required" value="-1" <% if(obj.project.state==-1){ %> checked="checked" <% } %>/>未启用
                      	<input type="radio" name="state" required="required" value="1"  <% if(obj.project.state==1){ %> checked="checked" <% } %>/>停用
                   	</div>
             	</div>
            	<div class="form-group">
               		<label for="remark" class="col-sm-2 control-label">备注</label>

                   	<div class="col-sm-8">
                    	<textarea rows="5" cols="5" id="remark" class="form-control" name="remark"    data-parsley-maxlength="5000"  placeholder="备注">${obj.project.remark!}</textarea>
                   	</div>
              	</div>
     		</div>
   		</div>
    </div>
	<div class="modal-footer">
		<button  class="btn btn-default btn-sm btn-parsley"  >完成</button> 
	</div>
</form>

<script language="JavaScript">
    $(document).ready(function () {
    	var dialog=$("#editModal");
		$("#editModalDialog").draggable();
        $('#eidtForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    datatable.ajax.reload();
	               	dialog.modal("hide");
                } else {
                    Toast.error(data.msg);
                    datatable.ajax.reload();
                 	dialog.modal("hide");
                }
            }
        });
    });
</script>
